// component/cellbox/cellbox.js
import Dialog from '../../miniprogram_npm/@vant/weapp/dialog/dialog';
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    celllist:{
      type:Array
    }
  },
  options:{
    addGlobalClass:true
  },
  /**
   * 组件的初始数据
   */
  data: {
    show: true,
  },

  /**
   * 组件的方法列表
   */
  lifetimes:{
    ready(){
      // this.$mp.page.selectComponent('#swipe-cell').open("right")
    }
  },
  methods: {
    onClick(e){
      console.log(e)
    },
    onClose(event) {
      var that = this;
      const { position, instance } = event.detail;
      // console.log(event.detail)
      let data = {pk:event.detail.name}
      getApp().ports.api35Del({data:data}).then((res) => {
        this.triggerEvent("delete",res)
        instance.close();
        // console.log(res)
        this.setData({ remind : res.results })
      }).catch((error)=>{console.log(error)})
    },
    clickbtn(e){
      // console.log(e.currentTarget.dataset.list)
      let  list = e.currentTarget.dataset.list;
      let ordertype = list.noticeType-1;
      let id = 0;
      if(list.noticeType == 1){
        id = list.foreclosedHouseId
      }else{
        id = list.discountHouseId
      }
      wx.navigateTo({
        url: '/pages/details/details?id='+id+'&status='+ordertype,
      })
    },
  }
})
